window.onload = function (){

     /**
      *   load ： 在页面第一次被加载时触发
      *   作用如下：
      *   1. 页面初始化
      *   2. 事件绑定
      *     click
      *     keyup keydown
      *     change
      * */

     initSelect();
    // initTable();

    var btnQuery=document.getElementById('btnQuery');
    var txtNO = document.getElementById('txtNO');
    var err=document.getElementById('err');
    var sltSchool = document.getElementById('sltSchool');

    txtNO.onkeyup =function (){

       var txt=  this.value;

       if(txt!='a'){

            err.innerText = '输入内容不符合规则！';
       }

    }

    sltSchool.onchange = function (){
         err.innerText = this.selectedOptions[0].value;
    }

    btnQuery.onclick = function (){


    }
}


function initSelect(){

    var sltSchool = document.getElementById('sltSchool');

    for (var i in schools){
        var opt = '<option value="'+schools[i].id+'">'+schools[i].name+'</option>';
        sltSchool.innerHTML+= opt;
    }
}